import { defHttp } from "@/utils/http";

// ERP 投标类型 VO
export interface BidTypeVO {
	id: number; // 主键
	name: string; // 名称
}

// ERP 投标类型 API
export const BidTypeApi = {
	// 查询投标类型分页
	getBidTypePage: async (params: any) => {
		return await defHttp.get({ url: `/whs/bidding-type/page`, params });
	},

	// 查询投标类型详情
	getBidType: async (id: number) => {
		return await defHttp.get({ url: `/whs/bidding-type/get?id=` + id });
	},

	// 新增投标类型
	createBidType: async (data: BidTypeVO) => {
		return await defHttp.post({ url: `/whs/bidding-type/create`, data });
	},

	// 修改投标类型
	updateBidType: async (data: BidTypeVO) => {
		return await defHttp.put({ url: `/whs/bidding-type/update`, data });
	},

	// 删除投标类型
	deleteBidType: async (id: number) => {
		return await defHttp.delete({
			url: `/whs/bidding-type/delete?id=` + id
		});
	},

	// 导出投标类型 Excel
	exportBidType: async (params: any) => {
		return await defHttp.download({ url: `/whs/bidding-type/export-excel`, params });
	}
};
